package com.registration.bean;

import javax.persistence.Transient;
import java.util.Date;

public class UserBean {
    //用户
    private Integer user_id;//用户 ID（自增）
    private String phone;//手机号（唯一，用于登录）
    private String password;//加密后的密码（BCrypt 加密）
    private String    username;//用户名
    private Integer   gender;//性别（0 - 未知，1 - 男，2 - 女）
    private Date birth_date;//出生日期
    private String  avatar;//头像 URL
    private Integer  status;//状态（0 - 禁用，1 - 正常）
    private Date  register_time;//注册时间
    private Date  last_login_time;//最后登录时间
    private Date  update_time;//记录更新时间

    @Transient // 关键：标记为非数据库字段，不影响数据库表结构
    private Integer code;

    @Override
    public String toString() {
        return "UserBean{" +
                "user_id=" + user_id +
                ", phone='" + phone + '\'' +
                ", password='" + password + '\'' +
                ", username='" + username + '\'' +
                ", gender=" + gender +
                ", birth_date=" + birth_date +
                ", avatar='" + avatar + '\'' +
                ", status=" + status +
                ", register_time=" + register_time +
                ", last_login_time=" + last_login_time +
                ", update_time=" + update_time +
                '}';
    }

    public UserBean(String phone, String password, Integer status, Date register_time,Integer code) {
        this.phone = phone;
        this.password = password;
        this.status = status;
        this.register_time = register_time;
        this.code = code;
    }

    public UserBean() {
    }

    public Integer getUser_id() {
        return user_id;
    }

    public void setUser_id(Integer user_id) {
        this.user_id = user_id;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Integer getGender() {
        return gender;
    }

    public void setGender(Integer gender) {
        this.gender = gender;
    }

    public Date getBirth_date() {
        return birth_date;
    }

    public void setBirth_date(Date birth_date) {
        this.birth_date = birth_date;
    }

    public String getAvatar() {
        return avatar;
    }

    public void setAvatar(String avatar) {
        this.avatar = avatar;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Date getRegister_time() {
        return register_time;
    }

    public void setRegister_time(Date register_time) {
        this.register_time = register_time;
    }

    public Date getLast_login_time() {
        return last_login_time;
    }

    public void setLast_login_time(Date last_login_time) {
        this.last_login_time = last_login_time;
    }


    public Date getUpdate_time() {
        return update_time;
    }

    public void setUpdate_time(Date update_time) {
        this.update_time = update_time;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }
}
